<?php
/**
 * 站点编辑处理类
 * Created		: 2012-05-21
 * Modified		: 2012-05-21
 * @version		: 0.0.1
 * @author		: Joseph Chen (chenliq@gmail.com)
 */
class CoreSiteBuilder 
{
	
	public $themePath = '';
	public $themeName = '';
	
	/**
	 * 构造函数
	 */
	public function __construct($themePath=null, $themeName=null) 
	{
		if ($themePath) {
			$this->themePath = $themePath;
			$this->themeName = $themeName;
		}
	}
	
	/**
	 * 获取主题列表
	 */
	public function getThemeList() 
	{
		$list = array();
		$dir = dir($this->themePath);
		while (false !== ($entry = $d->read())) {
			if ($entry == '.' || $entry == '..') {
				continue;
			}
			if (!is_dir($entry)) {
				continue;
			}
			$list[] = $entry;
		}
		$d->close();
		return $list;
	}
	
	/**
	 * 预览指定主题下的所有页面列表
	 * @param $theme 指定的主题名
	 */
	public function previewIndex($theme) 
	{
		;
	}
	
}